function [y, H] = generate_mimo_system(Nt, Nr, SNR)
    % 生成MIMO信道矩阵
    H = (randn(Nr, Nt) + 1j*randn(Nr, Nt))/sqrt(2);
    
    % 生成发送信号
    x = (randi([0,1], Nt, 1)*2-1) + 1j*(randi([0,1], Nt, 1)*2-1);
    
    % 添加噪声
    noise = (randn(Nr,1) + 1j*randn(Nr,1))/sqrt(2);
    noise = noise * 10^(-SNR/20);
    
    % 接收信号
    y = H*x + noise;
end 